import Vue from 'vue'
import App from './App.vue'
import router from './router'
import getData from './api'
import store from './store'

import 'lib-flexible/flexible'
import filters from './filter'
import ut from './utils'
import Toast from './toast'
import Toast from './toast'
import Sign from './sign'//登录弹窗组件
import 'swiper/dist/css/swiper.css'  //引入轮播样式
import './assets/font.css'
import './assets/common.less'
import dowloadBtn from './components/Button'
import vueSwiper from 'vue-awesome-swiper'
import Pagination from "@/components/Pagination"//pc端翻页

import {InfiniteScroll,Header,Popup,Navbar,Tabbar, TabItem,TabContainer,TabContainerItem   } from 'mint-ui'

Vue.prototype.$ajax=getData;
//Vue.prototype.$toast=Toast;,Toast

Vue.prototype.$zero=ut.setZero;

const components = {    
  Buttons:dowloadBtn,
  Header:Header.name,
  Popup:Popup.name,
  Navbar:Navbar.name,
  Tabbar:Tabbar.name
  TabItem:TabItem.name
  TabContainer:TabContainer.name
  TabContainerItem:TabContainerItem.name
  Pagination:Pagination.name
};
const install = () => {    
  Object.keys(components).forEach((key) => {
    Vue.component(key, components[key]);
  });
};
Vue.use(Sign)
Vue.use(install);
Vue.use(vueSwiper)
Vue.use(InfiniteScroll)
Vue.use(Toast,{    //支持全局配置
  defaultType: "top",
  duration: "2000"
})
Object.keys(filters).forEach(key => Vue.filter(key,filters[key]))

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
